CloudKit Docs

Core components included in ChefDK

Berkshelf

Berkshelf is primarally a Cookbook dependency resolution tool. If you are familiar with Debian's Apt tool or Redhat's Yum tool for package dependency management, Berkshelf does for cookbooks what Apt / Yum do for packages.

For instance, our sample Jenkins cookbook depends on an additional Java cookbook in order to successfully 'converge'. By specifying the Java cookbook as a dependency in your cookbook and executing a berks install berkshelf will locate the java cookbook, and download it to your local machine for use (usually to ~/.berkshelf/cookbooks)

Berkshelf is also used to create 'bare' cookbok skeletons, or directory and file structures, to make it easier to start working on a new project

TestKitchen

Test Kitchen is a test harness tool to execute your configured code on one or more platforms in isolation. A driver plugin architecture is used which lets you run your code on various cloud providers and virtualization technologies.

We use Vagrant to drive Virtualbox for local development, but there are many other providers allowing you to interface with Amazon, Openstack, Docker, and more.

You will configure your TestKitchen suite mainly through 2 configuration files, a .kitchen.yml file that is typically included in pre-built cookbooks, and a .kitchen.local.yml.

.kitchen.yml is the primary configuration file. It will contain generic instructions on how to configure the VM, what Chef Cookbooks should be applied, and any specific attributes which should be used to build your local instance

.kitchen.local.yml is an override configuration file, which should be used to override default settings in the .kitchen.yml for settings that are unique to your local environment. A good example is local proxy settings you may need in your office to reach the internet. Your proxy settings may be different than someone in another part of the world, so instead of keeping them in the more generic .kitchen.yml for all to use, you would set them in your local override.

Common TestKitchen Commands

kitchen converge - Build my VM based on settings in .kitchen.yml kitchen list - Shows the status of my VM's defined in my .kitchen.yml kitchen login - Establish a passwordless SSH session to my local VM (yes you do have sudo access) kitchen destroy - Shutdown and delete my local VM instance Vagrant

Vagrant is a tool for building complete development environments. With an easy-to-use workflow and focus on automation, Vagrant lowers development environment setup time, increases development/production parity, and makes the "works on my machine" excuse a relic of the past.

Many developers use Vagrant as a standalone tool to spin up local VM instances. We won't interact directly with Vagrant though, we will use TestKitchen to interact with Vagrant (as a provider).

If you know a thing or two about Vagrant, awesome, but beware, messing around with vagrant configs that are managed by TestKitchen will likely cause unintended consequences!

VirtualBox

VirtualBox is a free and open source virtualization provider. It can run on Windows, Linux, OSX and Solaris, and supports a number of Guest operating systems, including Windows, Linux Variants, OpenBSD, etc...

TestKitchen will run VirtualBox in 'headless' mode, meaning it won't spawn the typical UI for interaction, the VM will be started in a background process...

Chef-Solo and Chef-zero

Chef-Solo is a version of the chef-client that allows using cookbooks on nodes without requiring access to a Chef Server. Chef-Solo runs locally and requires that a cookbook (and any of its dependencies) be on the same physical disk as the node. Chef-Solo does not support the following:

Node data storage Search indexes Centralized distribution of cookbooks A centralized API that interacts with and integrates infrastructure components Authentication or authorization Persistent attributes Chef-Zero is an updated version of chef-solo, and is essentially an in memory instance of a chef-server. Chef-Zero provides support for:

Node data storage Search In memory Persistence of attributes These features are all very helpful for developing dynamic, search based cookbooks, and is the recommended provisioner for TestKitchen